//用户管理模块的接口
import request from '@/utils/request'

import type {
    Book,
    BookDetailResponseData,
    BookResponseData, ResponseData
} from './type'
//枚举地址
enum API {
    //获取全部系统日志信息
    ALL_BOOKS_URL = '/admin/book/list/',
    ALL_ADD_BOOK_URL = '/admin/book/add',
    ALL_DELETEBYID_URL = '/admin/book/delete/',
    ALL_DELETEBYALL_URL = '/admin/book/batchDelete',

}
//获取系统日志的接口
export const reqListBook = (page: number, limit: number,username: string) =>
    request.get<any, BookResponseData>(
        API.ALL_BOOKS_URL + `${page}/${limit}/?username=${username}`,
    )

// 新增书籍
export const reqAddBook = (data: Book) =>
    request.post<any,ResponseData>(API.ALL_ADD_BOOK_URL, data);

export const reqDeleteBook = (id: number) =>
    request.delete<any, ResponseData>(API.ALL_DELETEBYID_URL + id);

export const reqDeleteBooks = (ids: number[]) =>
    request.delete<any, ResponseData>(API.ALL_DELETEBYALL_URL, { data: ids });


//
// // 根据日志id获取当条日志详情
// export const reqSystemLogDetail = (id:number) =>{
//     return request.get<any,SyslogDetailResponseData>(API.SYSTEM_LOG_DETAIL_URL+id)
// }



